import { request } from "../network/request";

export function getStatus() {
  return request({
    url: "/getStatus",
    method: "GET",
  });
}

export function addStatus({ name, type, Sclass, pType, project, time }) {
  return request({
    url: "/addStatus",
    method: "POST",
    data: {
      name: name,
      type: type,
      Ptype: pType,
      Sclass: Sclass,
      project: project,
      time: time,
    },
  });
}

export function delStatus({ id }) {
  return request({
    url: "/delStatus",
    method: "POST",
    data: {
      _id: id,
    },
  });
}

export function editStatus({ name, type, Sclass, pType, project, time, _id }) {
  return request({
    url: "/editStatus",
    method: "POST",
    data: {
      name: name,
      type: type,
      Ptype: pType,
      Sclass: Sclass,
      project: project,
      time: time,
      _id: _id,
    },
  });
}

export function filterStatus({ name, type, Sclass, pType, project, time }) {
  return request({
    url: "/filterStatus",
    method: "POST",
    data: {
      name: name,
      type: type,
      Ptype: pType,
      Sclass: Sclass,
      project: project,
      time: time,
    },
  });
}

export function getAbsence() {
  return request({
    url: "/getAbsence",
    method: "GET",
  });
}

export function addAbsence({ name, type, Sclass, idNo, time }) {
  return request({
    url: "/addAbsence",
    method: "POST",
    data: {
      name: name,
      type: type,
      Sclass: Sclass,
      idNo: idNo,
      time: time,
    },
  });
}

export function delAbsence({ id }) {
  return request({
    url: "/delAbsence",
    method: "POST",
    data: {
      _id: id,
    },
  });
}

export function editAbsence({ name, type, Sclass, idNo, time, _id }) {
  return request({
    url: "/editAbsence",
    method: "POST",
    data: {
      name: name,
      type: type,
      Sclass: Sclass,
      idNo: idNo,
      time: time,
      _id: _id,
    },
  });
}
